<?php
namespace app\models;
use yii\base\Model;

class Customer extends Model
{
    public $gender;
    public $email;
    public $openid;
    public $last_name;
    public $appid;
    public $mobile;
    public $birthday;

    // public static function tableName()
    // {
    //     return 'customer';
    // }

    /**
     * @inheritdoc
     */

    public function rules()
    {
        return [
            [['mobile','last_name','gender'],'required'],
            [['email'],"email"],
            [['mobile'], 'integer'],
            [['last_name'], 'string', 'min' => 2, 'max' => 8,"tooLong"=>"太长了", "tooShort"=>"太短了"],
//            [['author_name', 'author_vote','author_id'], 'safe'],
        ];
    }

    // /**
    //  * @inheritdoc
    //  */
    public function attributeLabels()
    {
        return [
            'mobile' => '手机号',
            'last_name' => '用户名',
            'gender' => '性别',
            'email' => '邮箱',
            'openid' => 'openid',
            'birthday' => '生日',
        ];
    }


}